<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
      <!-- amfe-flexible它会自动设置html的font-size,为屏幕宽度1/10 -->
      <script src="https://unpkg.com/amfe-flexible@2.2.1/index.js"></script>
      <style>
        *{
            padding: 0;
            margin: 0%;
        }
        #div{
           /* 在iphonese宽度为187px,把它转换成rem */
            /* width: 187px; */
            /* 1rem = 37.5px */
            /* width: 187/37.5 rem */
            /* 手动计算公式 */
            /* width: 4.986666666666666rem; */
            /* 通过扩展,自动做计算 */
            width: 4.9867rem;
            height: 50px;
            background-color: pink;
        }
    </style>
</head>

<body>
    <div id="div"></div>
</body>
</html>